 {layout name="common/layout" /}

 <style>
 .cash-content{
     margin: 0;
     margin-top: 20px;
     background:#f9f9f9;
     border:none;
     box-sizing: border-box;
     padding-left: 50px;
 }
 </style>
<div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a></div>
<div class="Hui-article-box" style="margin-top: 37px;">
        <div class="newCrumbs ">提现
                
            </div>
	<div class="Hui-article">
		<div class="cash-content">
                <span>提现金额</span>
                    <input type="text" class="input-text radius size-M" id="money"  placeholder="请输入提现金额" />
                    <span style="color: #fbb450;cursor: pointer;margin-left: 10px;" onclick="allFillIn()">全额</span>
            （账户余额￥<span id="merchant-coin" style="color: #ff0000;">{$data.merchant_coin|sprintf ="%.2f",###}</span>）
                <p>每天可提额度为￥50,000</p>
                <button class="withdrawals">提现</button>

        </div>
	</div>	
</div>
 <script>
    function allFillIn() {
        var money = $('#merchant-coin').html();
        if (money > 50000) {
            money = 50000;
        }
        $('#money').val(money);
    }
	$(function(){
	$.Huitab("#tab_demo .tabBar span","#tab_demo .tabCon","current","click","1")});

    $('.withdrawals').click(function(){
        var money = $('#money').val();
        if (money > 50000) {
            alert('每天可提额度为￥50,000');
        } else if (money <= 1) {
            alert('提现金额必须大于￥1');
        } else {
            $.post("{:url('withdraw/withdrawals')}",{withdraw_money:money},function(ret){
                alert(ret.msg);
                if(ret.status == 200){
                    window.location.reload();
                }
            });
        }
    })
</script>
 